package main

import (
	"encoding/json"
	"fmt"
)

type Student struct {
	ID     int
	Gender string
	Name   string
}

type Class struct {
	Title   string
	Student []Student
}

func main() {
	str := `{"Title":"二班","Student":[{"ID":1,"Gender":"男","Name":"stu_1"},{"ID":2,"Gender":"男","Name":"stu_2"},{"ID":3,"Gender":"男","Name":"stu_3"},{"ID":4,"Gender":"男","Name":"stu_4"},{"ID":5,"Gender":"男","Name":"stu_5"},{"ID":6,"Gender":"男","Name":"stu_6"},{"ID":7,"Gender":"男","Name":"stu_7"},{"ID":8,"Gender":"男","Name":"stu_8"},{"ID":9,"Gender":"男","Name":"stu_9"}]}`

	var c1 Class
	err := json.Unmarshal([]byte(str), &c1)
	if err != nil {
		fmt.Println(err)
	} else {

		//fmt.Println(c1)
		fmt.Printf("%#v\n", c1)
	}

}
